function lovetime() {
  var seconds = 1000;
  var minutes = seconds * 60;
  var hours = minutes * 60;
  var days = hours * 24;
  var years = days * 365;
  var today = new Date();
  var todayYear = today.getFullYear();
  var todayMonth = today.getMonth();
  var todayDate = today.getDate();
  var todayHour = today.getHours();
  var todayMinute = today.getMinutes();
  var todaySecond = today.getSeconds();
  // 修改这里时间即可2022-1-4 19:00:00 东八区
  var t1 = Date.UTC(2022, 0, 4, 11, 00, 00);
  var t2 = Date.UTC(
    todayYear,
    todayMonth,
    todayDate,
    todayHour,
    todayMinute,
    todaySecond
  );
  var diff = t2 - t1;
  var diffYears = Math.floor(diff / years);
  var diffDays = Math.floor(diff / days - diffYears * 365);
  var diffHours = Math.floor(
    (diff - (diffYears * 365 + diffDays) * days) / hours
  );
  var diffMinutes = Math.floor(
    (diff - (diffYears * 365 + diffDays) * days - diffHours * hours) / minutes
  );
  var diffSeconds = Math.floor(
    (diff -
      (diffYears * 365 + diffDays) * days -
      diffHours * hours -
      diffMinutes * minutes) /
      seconds
  );
  document.getElementById("lovetime").innerHTML =
    "Love Days<br/>" +
    (diffYears > 0 ? diffYears + "年" : "") +
    diffDays +
    "天" +
    diffHours +
    "小时" +
    diffMinutes +
    "分钟" +
    diffSeconds +
    "秒";
}

var pathname = window.location.pathname;
if (pathname.indexOf("timeline")) {
  lovetime();
  window.setTimeout("lovetime()", 1000);
}
